module.exports.parse = async (
  raw,
  { axios, yaml, notify, console },
  { name, url, interval, selected }
) => {
  const obj = yaml.parse(raw)
  console.log("检查名称：", name)
  console.log("检查URL：", url)
  console.log("检查更新间隔：", interval)
  console.log(selected)
  // obj["dns"]["enhanced-mode"] = "fake-ip"
  // obj["rules"] = [
  //   "DOMAIN-SUFFIX,ip-api.com,DIRECT",
  //   "DOMAIN-SUFFIX,ipip.net,DIRECT",
  //   "DOMAIN-SUFFIX,ip138.com,DIRECT",
  //   "DOMAIN-SUFFIX,stunnel.vip,DIRECT",
  //   "DOMAIN-SUFFIX,gotochinatown.net,DIRECT",
  //   "DOMAIN-SUFFIX,ghelper.org,DIRECT",
  //   "DOMAIN-SUFFIX,fastapi.me,DIRECT",
  //   "DOMAIN-SUFFIX,vps315.com,DIRECT",
  //   "DOMAIN-SUFFIX,copyplay.net,DIRECT",
  //   "DOMAIN-SUFFIX,pickdown.net,DIRECT",
  //   "DOMAIN-SUFFIX,ggsync.net,DIRECT",
  //   "DOMAIN-SUFFIX,ghelpersync.com,DIRECT",
  //   "DOMAIN-SUFFIX,ghelpersync.net,DIRECT",
  //   "DOMAIN-SUFFIX,cnsync.net,DIRECT",
  //   "DOMAIN-SUFFIX,browserapi.net,DIRECT",
  //   "DOMAIN-KEYWORD,google,Ghelper",
  //   "DOMAIN-KEYWORD,youtube,Ghelper",
  //   "DOMAIN-SUFFIX,ggpht.com,Ghelper",
  //   "DOMAIN-SUFFIX,gmail.com,Ghelper",
  //   "DOMAIN-SUFFIX,gvt2.com,Ghelper",
  //   "DOMAIN-SUFFIX,gvt3.com,Ghelper",
  //   "DOMAIN-SUFFIX,chrome.com,Ghelper",
  //   "DOMAIN-SUFFIX,wikipedia.org,Ghelper",
  //   "DOMAIN-SUFFIX,wikimedia.org,Ghelper",
  //   "DOMAIN-SUFFIX,appspot.com,Ghelper",
  //   "DOMAIN-SUFFIX,android.com,Ghelper",
  //   "DOMAIN-SUFFIX,github.com,Ghelper",
  //   "DOMAIN-SUFFIX,gitbook.com,Ghelper",
  //   "DOMAIN-SUFFIX,kaggle.com,Ghelper",
  //   "DOMAIN-SUFFIX,arxiv.org,Ghelper",
  //   "DOMAIN-SUFFIX,wiktionary.org,Ghelper",
  //   "DOMAIN-SUFFIX,blogger.com,Ghelper",
  //   "DOMAIN-SUFFIX,youtu.be,Ghelper",
  //   "DOMAIN-SUFFIX,ytimg.com,Ghelper",
  //   "DOMAIN-SUFFIX,youtube.com,Ghelper",
  //   "DOMAIN-SUFFIX,instagram.com,Ghelper",
  //   "DOMAIN-SUFFIX,twitter.com,Ghelper",
  //   "DOMAIN-SUFFIX,t.co,Ghelper",
  //   "DOMAIN-SUFFIX,facebook.com,Ghelper",
  //   "DOMAIN-SUFFIX,telegram.org,Ghelper",
  //   "DOMAIN-SUFFIX,whatsapp.com,Ghelper",
  //   "DOMAIN-SUFFIX,whatsapp.net,Ghelper",
  //   "DOMAIN-SUFFIX,linkedin.com,Ghelper",
  //   "DOMAIN-SUFFIX,licdn.com,Ghelper",
  //   "DOMAIN-SUFFIX,trkn.us,Ghelper",
  //   "DOMAIN-SUFFIX,cedexis.com,Ghelper",
  //   "DOMAIN-SUFFIX,openai.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,auth0.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,featuregates.org,ChatGPT专线",
  //   "DOMAIN-SUFFIX,statsigapi.net,ChatGPT专线",
  //   "DOMAIN-SUFFIX,intercom.io,ChatGPT专线",
  //   "DOMAIN-SUFFIX,intercomcdn.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,sentry.io,ChatGPT专线",
  //   "DOMAIN-SUFFIX,sentry.dev,ChatGPT专线",
  //   "DOMAIN-SUFFIX,ai.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,claude.ai,ChatGPT专线",
  //   "DOMAIN-SUFFIX,bing.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,microsoftonline.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,live.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,msecnd.net,ChatGPT专线",
  //   "DOMAIN-SUFFIX,msn.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,bingapis.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,bing.net,ChatGPT专线",
  //   "DOMAIN-SUFFIX,windows.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,microsoft.com,ChatGPT专线",
  //   "DOMAIN-SUFFIX,linkedin.com,Ghelper",
  //   "DOMAIN-SUFFIX,licdn.com,Ghelper",
  //   "DOMAIN-SUFFIX,trkn.us,Ghelper",
  //   "DOMAIN-SUFFIX,cedexis.com,Ghelper",
  //   "GEOIP,CN,DIRECT",
  //   "MATCH, Ghelper",
  // ]
  obj["rule-providers"] = {
    reject: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt",
      path: "./ruleset/reject.yaml",
      interval: 86400,
    },
    icloud: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt",
      path: "./ruleset/icloud.yaml",
      interval: 86400,
    },
    apple: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt",
      path: "./ruleset/apple.yaml",
      interval: 86400,
    },
    google: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt",
      path: "./ruleset/google.yaml",
      interval: 86400,
    },
    proxy: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt",
      path: "./ruleset/proxy.yaml",
      interval: 86400,
    },
    direct: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt",
      path: "./ruleset/direct.yaml",
      interval: 86400,
    },
    private: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt",
      path: "./ruleset/private.yaml",
      interval: 86400,
    },
    gfw: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt",
      path: "./ruleset/gfw.yaml",
      interval: 86400,
    },
    greatfire: {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/greatfire.txt",
      path: "./ruleset/greatfire.yaml",
      interval: 86400,
    },
    "tld-not-cn": {
      type: "http",
      behavior: "domain",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt",
      path: "./ruleset/tld-not-cn.yaml",
      interval: 86400,
    },
    telegramcidr: {
      type: "http",
      behavior: "ipcidr",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt",
      path: "./ruleset/telegramcidr.yaml",
      interval: 86400,
    },
    cncidr: {
      type: "http",
      behavior: "ipcidr",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt",
      path: "./ruleset/cncidr.yaml",
      interval: 86400,
    },
    lancidr: {
      type: "http",
      behavior: "ipcidr",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt",
      path: "./ruleset/lancidr.yaml",
      interval: 86400,
    },
    applications: {
      type: "http",
      behavior: "classical",
      url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt",
      path: "./ruleset/applications.yaml",
      interval: 86400,
    },
  }
  return yaml.stringify(obj)
}
